package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Set;

import java.util.Iterator;

import org.testng.annotations.Test;

import com.example.fw.GroupObject;
import com.example.fw.Groups;

public class GroupRemovalTest extends TestBase {
	
	@Test
	public void testFirstGroupCanBeRemoved() throws Exception {
		Groups oldList = app.getGroupHelper().getGroups();
		Set<GroupObject> groups = app.getGroupHelper().getGroups();
		GroupObject someGroup = groups.iterator().next();
		//app.getGroupHelper().deleteGroup(0);
		app.getGroupHelper().deleteGroup(someGroup);
		Groups newList = app.getGroupHelper().getGroups();
		//Set<GroupObject> groups = app.getGroupHelper().getGroups();
		//verifyGroupRemoval(oldList, newList);
		
		
		assertThat(newList, equalTo(oldList.without(someGroup)));
	}
}

